home *** CD-ROM | disk | FTP | other *** search
/ Aminet 50 / Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso / Aminet / text / edit / tecoc-146.lha / exeey.c < prev    next >
C/C++ Source or Header  |  1991-07-05  |  1KB  |  51 lines

  1. /*****************************************************************************
  2.  
  3.     ExeEY()
  4.  
  5.     This function executes an EY command.
  6.  
  7. *****************************************************************************/
  8.  
  9. #include "zport.h"        /* define portability identifiers */
  10. #include "tecoc.h"        /* define general identifiers */
  11. #include "defext.h"        /* define external global variables */
  12.  
  13. DEFAULT ExeEY()            /* execute an EY command */
  14. {
  15.     BOOLEAN    ColonMod;
  16.  
  17.     DBGFEN(1,"ExeEY",NULL);
  18.  
  19.     ColonMod = (CmdMod & COLON);        /* is it :EY ? */
  20.     CmdMod &= ~COLON;            /* clear modifiers flags */
  21.  
  22.     GapBeg = EBfBeg;            /* clear the...   */
  23.     GapEnd = EBfEnd;            /*   ...edit buffer */
  24.  
  25.     if (IsEofI[CurInp]) {            /* if at end-of-file */
  26.         if (ColonMod) {            /* if it's :EY */
  27.             DBGFEX(1,DbgFNm,"PushEx(0)");
  28.             return PushEx(0L, OPERAND);
  29.         } else {
  30.             EStTop = EStBot;    /* clear expression stack */
  31.             DBGFEX(1,DbgFNm,"SUCCESS");
  32.             return SUCCESS;
  33.         }
  34.     }
  35.  
  36.     if (RdPage() == FAILURE) {        /* read a page */
  37.         DBGFEX(1,DbgFNm,"FAILURE");
  38.         return FAILURE;
  39.     }
  40.  
  41.     if (ColonMod) {                /* if it's :EY */
  42.         DBGFEX(1,DbgFNm,"PushEx(-1)");
  43.         return PushEx(-1L, OPERAND);
  44.     }
  45.  
  46.     EStTop = EStBot;            /* clear expression stack */
  47.  
  48.     DBGFEX(1,DbgFNm,"SUCCESS");
  49.     return SUCCESS;
  50. }
  51.